package org.itboys.weixin.service;

import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseService;
import org.itboys.weixin.entity.CommissionConfig;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2016/6/22.
 */
@Service
public class CommissionConfigService extends BaseService<CommissionConfig, Long> {

    @Resource(name = "adminDS")
    private MongoDataSource ds;

    @Override
    protected MongoDataSource getMongoDataSource() {
        return ds;
    }

    @Override
    protected Class<CommissionConfig> getEntityClass() {
        return CommissionConfig.class;
    }

    public CommissionConfig getConfig() {
        return getMongoDataSource().createQuery(CommissionConfig.class).get();
    }
}
